package cn.net.autocode.platform.table.ddl;

import cn.net.autocode.dbManager.Dao;
import cn.net.autocode.platform.table.ddl.mysql.MySqlDataBaseDDL;
import cn.net.autocode.platform.table.ddl.oracle.OracleDataBaseDDL;
import cn.net.autocode.platform.table.ddl.sqlserver.SqlServerDataBaseDDL;


public class DatabaseDDLFactory {

    public static DataBaseDDL newInstance(Dao dao){
        return switch (dao.getDbType()) {
            case "MYSQL" -> new MySqlDataBaseDDL(dao);
            case "SQL_SERVER" -> new SqlServerDataBaseDDL(dao);
            case "ORACLE" -> new OracleDataBaseDDL(dao);
            default -> throw new RuntimeException("该类型数据库未实现");
        };
    }

}
